import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from "@/views/login/login.vue"
import Main from "@/views/main/index.vue"
import Home from "@/views/home/index.vue"
import Travel from '@/views/travel/index.vue'


Vue.use(VueRouter)

//天气实况监测
const monitorRoutes = [
    { path: "live", component: () => import('@/views/home/monitor/live_statistics.vue') },//实况统计
    { path: "radar", component: () => import('@/views/home/monitor/weather_radar.vue') },//天气雷达
    { path: "rainfall_warning", component: () => import('@/views/home/monitor/rainfall_warning.vue') },//雨量预警
    { path: "satellite_cloud", component: () => import('@/views/home/monitor/satellite_cloud.vue') },//卫星云图
    { path: "rainfall_monitor", component: () => import('@/views/home/monitor/rainfall_monitoring_alarm.vue') },//雨量监测报警
    { path: "temperature_monitor", component: () => import('@/views/home/monitor/temperature_monitoring_alarm.vue') },//气温监测报警
    { path: "monitoring_alarm_detail", component: () => import('@/views/home/monitor/monitoring_alarm_detail.vue') },//单站查询
    { path: "rainfall_status_forecast", component: () => import('@/views/home/monitor/rainfall_status_forecast.vue') },//雨量实况与预报
    { path: "rainfall_forecast_map", component: () => import('@/views/home/monitor/rainfall_forecast_map.vue') },//雨量预报分布图
    { path: "lightning_live", component: () => import('@/views/home/monitor/lightning_live.vue') },//闪电实况
    { path: "weather_live", component: () => import('@/views/home/monitor/weather_live.vue') },//天气实况
    { path: "average_rainfall", component: () => import('@/views/home/monitor/average_rainfall.vue') },//各县区逐日平均雨量
]

// 气象服务产品
const serviceProductRoutes = [
    { path: "gpre", component: () => import('@/views/home/service_product/Geologica_prediction') },//地质灾害气象风险等级预报
    { path: "fpre", component: () => import('@/views/home/service_product/flood_prediction') },//山洪灾害气象风险等级预报
    { path: "short_time", component: () => import('@/views/home/service_product/short_time') }, //短时临近天气预报
    { path: "rainfall_report", component: () => import('@/views/home/service_product/Rainfall_report') },//雨量现报
    { path: "mete_infor", component: () => import('@/views/home/service_product/meteorological_information') },//气象信息快报
    { path: "major", component: () => import('@/views/home/service_product/major_meteorological') },//重大气象信息专报
    { path: "pro", component: () => import('@/views/home/service_product/professional_weather_forecast') },//专业天气预报
    { path: "rain_situation", component: () => import('@/views/home/service_product/rain_situation_report') },//雨情快报
    { path: "72hour", component: () => import('@/views/home/service_product/72hour') },//72小时天气预报
    { path: "air_pollution", component: () => import('@/views/home/service_product/air_pollution') },//空气污染扩散气象条件等
]

// 精准靶向服务产品
const targettingRoutes = [
    { path: "rainfall_disaster", component: () => import('@/views/home/targetting/rainfall_disaster.vue') },//地灾点雨量
    { path: "disaster_rainfall_warning", component: () => import('@/views/home/targetting/disaster_rainfall_warning.vue') },//地灾雨量预警
    { path: "flood_rainfall_warning", component: () => import('@/views/home/targetting/flood_rainfall_warning.vue') },//山洪危险区雨量
    { path: "flood_warning", component: () => import('@/views/home/targetting/flood_warning.vue') },//山洪雨量预警
]

//精细化天气预报
const refinedRoutes = [
    { path: "threeDay", component: () => import('@/views/home/refined_weather/3day_forecast.vue') },//未来3天预报
    { path: "sevenDay", component: () => import('@/views/home/refined_weather/7day_forecast.vue') },//7天预报
    { path: "hours", component: () => import('@/views/home/refined_weather/24hour_forecast.vue') },//24小时预报
    { path: "extend", component: () => import('@/views/home/refined_weather/extend_forecast.vue') }, //未来3天预报

]

//灾害性天气预警
const disasterRoutes = [
    { path: "disaster_warning", component: () => import('@/views/home/disaster_weather/disaster_warning.vue') },//灾害预警
    { path: "warning_signal", component: () => import('@/views/home/disaster_weather/warning_signal.vue') },//预警信号
    { path: "severe_weather", component: () => import('@/views/home/disaster_weather/severe_weather.vue') },//恶劣天气预警
]

//闭环管理
const closeRoutes = [
    { path: "disaster_warning_receipt", component: () => import('@/views/home/closed_loop/disaster_warning_receipt.vue') },//地灾预警回执
    { path: "flood_warning_receipt", component: () => import('@/views/home/closed_loop/flood_warning_receipt.vue') },//山洪预警回执
    { path: "rainfall_disasters", component: () => import('@/views/home/closed_loop/rainfall_disasters.vue') },//降水短临回执(地灾)
    { path: "rainfall_flood", component: () => import('@/views/home/closed_loop/rainfall_flood.vue') },//降水短临回执(山洪)
    { path: "strom_disaster", component: () => import('@/views/home/closed_loop/strom_disaster.vue') },//暴雨预警回执（地灾）
    { path: "strom_flood", component: () => import('@/views/home/closed_loop/strom_flood.vue') },//暴雨预警回执（山洪）
    { path: "closed_loop_rate", component: () => import('@/views/home/closed_loop/closed_loop_rate.vue') },//闭环率统计
    { path: "receipt_detail", component: () => import('@/views/home/closed_loop/receipt_detail.vue') },//回执详细
    { path: "imageAndTextReview", component: () => import('@/views/home/closed_loop/imageAndTextReview.vue') },//图文审核

]

//基础信息管理
const managementRoutes = [
    { path: "warning", component: () => import('@/views/home/management/warning.vue') },//预警接收管理
    { path: "information", component: () => import('@/views/home/management/information.vue') },//灾害点信息管理
]

//森林火险气象感知预报
const forestRoutes = [
    { path: "3days", component: () => import('@/views/home/forest/3days.vue') },//3天预报
    { path: "10days", component: () => import('@/views/home/forest/10days.vue') },//10天预报
    { path: "high_risk", component: () => import('@/views/home/forest/10days.vue') },//高危点位预报
]

//短临预报产品
const shortRoutes = [
    { path: "1hour", component: () => import('@/views/home/short_term/1hour.vue') },//1小时雨量预报
    { path: "nowcasting", component: () => import('@/views/home/short_term/nowcasting.vue') },//灾害性短时临近预报
    { path: "0_2hour", component: () => import('@/views/home/short_term/0_2hour.vue') },//0~2小时雨量预报图
    { path: "rainfall_situation", component: () => import('@/views/home/short_term/rainfall_situation.vue') }, //雨量现报
    { path: "climate_trend", component: () => import('@/views/home/short_term/climate_trend.vue') }, //气候趋势预警
]

//气象风险等级预报
const levelRoutes = [
    { path: "disaster", component: () => import('@/views/home/risk_level/disaster.vue') },//地质灾害气象风险等级预报
    { path: "flood", component: () => import('@/views/home/risk_level/flood.vue') },//山洪灾害气象风险等级预报
]
//精细化短临预报
const refinementRoutes = [
    { path: "short_term_crisis", component: () => import('@/views/home/refinement/short_term_crisis.vue') },//灾害性短临预报
    { path: "24hours", component: () => import('@/views/home/refinement/24hours.vue') },//24小时预报
]

//专业专项服务产品
const professionalRoutes = [
    { path: "basin", component: () => import('@/views/home/professional_specialization/basin.vue') },//流域预报
    { path: "county", component: () => import('@/views/home/professional_specialization/county.vue') },//区县预报
    { path: "week", component: () => import('@/views/home/professional_specialization/week.vue') },//周报
    { path: "10day", component: () => import('@/views/home/professional_specialization/10day.vue') },//旬报
    { path: "month", component: () => import('@/views/home/professional_specialization/month.vue') },//月报
]

//用户页面
const user = [
    { path: "user", component: () => import('@/views/home/user/index.vue') },//流域预报
]
const routes = [
    {
        path: "/",
        redirect: "/login",
        // redirect: "/home",
        component: Main,
        children: [
            { path: "home", name: "home", component: Home },
            ...user,//用户页面
            ...serviceProductRoutes, // 气象服务产品
            ...targettingRoutes,    // 精准靶向服务产品
            ...monitorRoutes,      //天气实况监测
            ...refinedRoutes,      //精细化天气预报
            ...disasterRoutes,     //灾害性天气预警
            ...closeRoutes,        //闭环管理
            ...managementRoutes,   //基础信息管理
            ...forestRoutes,      //森林火险气象感知预报
            ...shortRoutes,     //短期雨量预警
            ...levelRoutes,    //气象风险等级预报
            ...refinementRoutes, //精细化短临预报
            ...professionalRoutes //专业专项预报
        ],
    },
    {
        path: "/login",
        component: Login,
    },


    // 旅游平台
    {
        path: "/travel",
        component: Travel,
        children: [
            { path: "home", component: () => import('@/views/travel/home/index.vue') },//首页
            {
                path: "monitor",
                component: () => import('@/views/travel/monitor/index.vue'), // 实况监测
                redirect: { path: "monitor/precipitation" },
                children: [
                    { path: "precipitation", component: () => import('@/views/travel/monitor/index/precipitation.vue'), },// 降水
                    { path: "temperature", component: () => import('@/views/travel/monitor/index/temperature.vue'), },// 气温
                    { path: "humidity", component: () => import('@/views/travel/monitor/index/humidity.vue'), },// 相对湿度
                    { path: "wind", component: () => import('@/views/travel/monitor/index/wind.vue'), },// 风向风速
                    { path: "negative-ions", component: () => import('@/views/travel/monitor/index/negative-ions.vue'), },// 负氧离子
                    { path: "radar", component: () => import('@/views/travel/monitor/index/radar.vue'), },// 雷达回波
                    { path: "scenery", component: () => import('@/views/travel/monitor/index/scenery.vue'), },// 景区实景
                ]
            },//实况监测
            { path: "forecast", component: () => import('@/views/travel/forecast/index.vue') },//天气预报
            { path: "warning", component: () => import('@/views/travel/warning/index.vue') },//熔断预警
            {
                path: "baseuser", component: () => import('@/views/travel/user/index.vue'),
                redirect: { path: "baseuser/disaster_manage" },
                children: [
                    { path: "disaster_manage", component: () => import('@/views/travel/user/Geological_disaster.vue'), },
                    { path: "warning_manage", component: () => import('@/views/travel/user/warning_manage.vue'), },
                ]
            },//基础信息管理
        ],
    }
]

const router = new VueRouter({
    routes
})

export default router
